<script setup lang="ts">
import { inject } from 'vue'
import ChildComp from './ChildComp.vue'

// 祖先传后代
// 通过 inject 接收并使用 Provide 注入的值
const count = inject<number>('count')
const updateCount = inject<(num: number) => void>('updateCount')
</script>

<template>
  <div class="parent-page" style="padding: 50px">
    parent 组件
    <h2 @click="updateCount!(50)">{{ count }}</h2>
    <hr />
    <ChildComp />
  </div>
</template>
